package org.example.restudying2.controller;

import org.example.restudying2.service.customerService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;
@RestController
@RequestMapping("/customer")
//用户顾客mapper
public class CustomerController {
    @Resource
    private customerService customerService;

    @PostMapping("/login")
    Map<String, Object> login(String customername, String password) {return this.customerService.login(customername,password);}
    @PostMapping("/register")
    Map<String, Object> register(String customername, String password, String email) {return this.customerService.register(customername,password,email);}
}
